<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            border: 3px solid pink;
            /* margin: 100px auto; */
            margin: 10px;
            float: left;
            overflow: hidden;
        }
        
        div::before {
            content: "黑马";
            width: 100%;
            height: 100%;
            display: block;
            background-color: honeydew;
            transform-origin: left bottom;
            transform: rotate(180deg);
            transition: all .5s;
        }
        
        div:nth-child(2)::before {
            content: "花牌";
        }
        /* 鼠标经过 div 里面的 before 复原 */
        
        div:hover::before {
            transform: rotate(0deg);
        }
    </style>
</head>

<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</body>

</html>